/* 封装存储和获取本地存储的方法 */

// 存储数据 
export const SET_LOCAL = (name: string, data: unknown) => {
    localStorage.setItem(name, JSON.stringify(data))
}

// 读取数据
export const GET_LOCAL = (name: string): string => {
    return JSON.parse(localStorage.getItem(name) as string)
}

// 清除数据
export const REMOVE_LOCAL = (name: string) => {
    localStorage.removeItem(name)
}